//
//  xianzhiViewController.m
//  Candy
//
//  Created by QUAQUA on 2018/3/22.
//  Copyright © 2018年 庄文盛 All rights reserved.
//

#import "xianzhiViewController.h"
#import "ReservationOederViewController.h"
#import "SWFormCommonController.h"
#import "ShopListController.h"

@interface xianzhiViewController ()
@property (weak, nonatomic) IBOutlet UILabel *adsName;
@property (weak, nonatomic) IBOutlet UIImageView *fanhui;
@property (weak, nonatomic) IBOutlet UILabel *distance;
@property (weak, nonatomic) IBOutlet UILabel *state;
@property (weak, nonatomic) IBOutlet UILabel *where;
@property (weak, nonatomic) IBOutlet UILabel *phone;
@property (weak, nonatomic) IBOutlet UIButton *btnImg;

@end

@implementation xianzhiViewController
- (IBAction)yuyue:(id)sender {
    ShopListController *vc = [ShopListController new];
    UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc];
    [self presentViewController:nav animated:YES completion:nil];
}

- (IBAction)dianji:(id)sender {
    ShopListController *vc = [ShopListController new];
    UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc];
    [self presentViewController:nav animated:YES completion:nil];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    UITapGestureRecognizer *tap1 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(ChargeEye)];
    [_fanhui setUserInteractionEnabled:YES];
    tap1.numberOfTapsRequired = 1;
    tap1.numberOfTouchesRequired = 1;
    [_fanhui addGestureRecognizer:tap1];
    
    self.distance.text =[NSString stringWithFormat:@"%@km", self.model.distance];
    self.storeName.text = self.model.shopName;
    self.state.text = self.model.state;
    self.costNumber.text = [NSString stringWithFormat:@"人均消费%@元",self.model.cost];
    self.adsName.text = self.model.shopName;
    self.where.text = [NSString stringWithFormat:@"地址：%@",self.model.address];
    self.phone.text = [NSString stringWithFormat:@"电话：%@",self.model.phone];
    if ([self.state.text isEqualToString:@"拥挤"]) {
        [self.btnImg setImage:[UIImage imageNamed:@"tabbar navi"] forState:UIControlStateNormal];
    }
    
}

-(void)ChargeEye{
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
